package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class MultisetIntersect implements MultisetTerm {

    private int beginIndex;
    private int endIndex;
    private MultisetTerm multisetTerm;
    private boolean all;
    private boolean distinct;
    private MultisetPrimary multisetPrimary;

    public MultisetIntersect(MultisetTerm multisetTerm,
                             boolean all,
                             boolean distinct,
                             MultisetPrimary multisetPrimary) {
        this.beginIndex = multisetTerm.getBeginIndex();
        this.endIndex = multisetPrimary.getEndIndex();
        this.multisetTerm = multisetTerm;
        this.all = all;
        this.distinct = distinct;
        this.multisetPrimary = multisetPrimary;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public MultisetTerm getMultisetTerm() {
        return multisetTerm;
    }

    public boolean isAll() {
        return all;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public MultisetPrimary getMultisetPrimary() {
        return multisetPrimary;
    }

}
